@extends('backend.template')

@section('main')
<div class="row">

    <div class="col-md-12">

    <button class="btn btn-primary btn-sm" onclick="location.href='/backend/cate-type/create'">Add new</button>

         <div class="box-header">

                <h3 class="box-title">Danh sách loại danh mục</h3>

            </div><!-- /.box-header -->

        <div class="box">        

            <div class="box-body">

                <table class="table table-striped table-bordered">
                    <thead>                    
                        <tr>
                            <th width="1%">No.</th>
                            <th width="30%">Tên loại</th>
                            <th width="40%">Thời gian tạo</th>
                            <th width="1%">Edit</th>
                            <th width="1%">Delete</th>                                                   
                        </tr>
                    </thead>

                    <tbody>
                        @if (!empty($dataArr))            
                            <?php $i = 0; ?>
                            @foreach ($dataArr as $data)
                            <?php $i++; ?>
                            <tr id="row-{{ $data->id }}">
                                <td width="1%" align="center">{{ $i }}</td>
                                <td width="30%">{{ $data->cate_type_name }}</td>
                                <td width="40%">{{ $data->created_at }}</td>                                      
                                
                                <td width="10%">{{ link_to_route('backend.cate-type.edit', 'Chỉnh sửa',
                         array($data->id), array('class' => 'btn btn-info')) }}</td>
                                <td width="10%">{{ Form::open(array('method' 
                        => 'DELETE', 'route' => array('backend.cate-type.destroy', $data->id))) }}                       
                                                    {{ Form::submit('Xóa', array('class'
                         => 'btn btn-danger','onclick'=>'return confirm("Are you sure you want to delete ?");')) }}
                                    {{ Form::close() }}
                                </td>
                            </tr>
                            @endforeach            
                            <tr>
                                <td colspan="6">{{ $dataArr->appends(Input::except('page'))->links(); }}</td>
                            </tr>
                            @else
                            <tr>
                                <td colspan="6">Not found data!</td>          
                            </tr>
                            @endif
                    </tbody>
                  
                </table>

            </div><!-- /.box-body -->

            <div class="box-footer clearfix">             

            </div>

        </div><!-- /.box -->

    </div><!-- /.col -->
</div>
@stop